<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha256-CTSx/A06dm1B063156EVh15m6Y67pAjZZaQc89LLSrU=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.24/fancybox/fancybox.css" integrity="sha256-vQkngPS8jiHHH0I6ABTZroZk8NPZ7b+MUReOFE9UsXQ=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"rjyblog.gitee.io","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.18.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":null},"fold":{"enable":false,"height":500},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="一次点击一般会有先后两个事件：PointerDownEvent和PointerUpEvent，分别表示按下down和抬起up（如果手指发生了滑动，还会有PointerMoveEvent事件）。本文分别分析按下和抬起两个事件的处理流程。 备注：本文以GestureDetector为示例进行点击事件处理流程的分析，基于Flutter 2.5.3。 PointerDownEvent（按下）事件的处理流程">
<meta property="og:type" content="article">
<meta property="og:title" content="Flutter点击事件处理机制">
<meta property="og:url" content="https://rjyblog.gitee.io/posts/be1f8948.html">
<meta property="og:site_name" content="任建勇的博客">
<meta property="og:description" content="一次点击一般会有先后两个事件：PointerDownEvent和PointerUpEvent，分别表示按下down和抬起up（如果手指发生了滑动，还会有PointerMoveEvent事件）。本文分别分析按下和抬起两个事件的处理流程。 备注：本文以GestureDetector为示例进行点击事件处理流程的分析，基于Flutter 2.5.3。 PointerDownEvent（按下）事件的处理流程">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-09-10T10:39:35.000Z">
<meta property="article:modified_time" content="2023-10-18T08:30:47.997Z">
<meta property="article:author" content="Jason">
<meta property="article:tag" content="Flutter">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://rjyblog.gitee.io/posts/be1f8948.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://rjyblog.gitee.io/posts/be1f8948.html","path":"posts/be1f8948.html","title":"Flutter点击事件处理机制"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>Flutter点击事件处理机制 | 任建勇的博客</title>
  








  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">任建勇的博客</p>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#PointerDownEvent%EF%BC%88%E6%8C%89%E4%B8%8B%EF%BC%89%E4%BA%8B%E4%BB%B6%E7%9A%84%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B"><span class="nav-text">PointerDownEvent（按下）事件的处理流程</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%91%BD%E4%B8%AD%E6%B5%8B%E8%AF%95-hitTest"><span class="nav-text">命中测试 hitTest</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#hitTestChildren"><span class="nav-text">hitTestChildren</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%82%B9%E5%87%BB%E4%BA%8B%E4%BB%B6%E5%88%86%E5%8F%91"><span class="nav-text">点击事件分发</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#PointerUpEvent%EF%BC%88%E6%8A%AC%E8%B5%B7%EF%BC%89%E4%BA%8B%E4%BB%B6%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B"><span class="nav-text">PointerUpEvent（抬起）事件处理流程</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#GestureDetector%E7%9B%B8%E5%85%B3%E7%9A%84%E7%B1%BB%E5%9B%BE"><span class="nav-text">GestureDetector相关的类图</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span class="nav-text">参考资料</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Jason"
      src="/images/avatar.png">
  <p class="site-author-name" itemprop="name">Jason</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">66</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">13</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/be1f8948.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="Flutter点击事件处理机制 | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Flutter点击事件处理机制
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-09-10 18:39:35" itemprop="dateCreated datePublished" datetime="2022-09-10T18:39:35+08:00">2022-09-10</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-10-18 16:30:47" itemprop="dateModified" datetime="2023-10-18T16:30:47+08:00">2023-10-18</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Flutter/" itemprop="url" rel="index"><span itemprop="name">Flutter</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>一次点击一般会有先后两个事件：PointerDownEvent和PointerUpEvent，分别表示按下down和抬起up（如果手指发生了滑动，还会有PointerMoveEvent事件）。本文分别分析按下和抬起两个事件的处理流程。</p>
<p>备注：本文以<code>GestureDetector</code>为示例进行点击事件处理流程的分析，基于Flutter 2.5.3。</p>
<h2 id="PointerDownEvent（按下）事件的处理流程"><a href="#PointerDownEvent（按下）事件的处理流程" class="headerlink" title="PointerDownEvent（按下）事件的处理流程"></a>PointerDownEvent（按下）事件的处理流程</h2><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="1341px" preserveAspectRatio="none" style="width:1035px;height:1341px;background:#FFFFFF;" version="1.1" viewBox="0 0 1035 1341" width="1035px" zoomAndPan="magnify"><defs/><g><rect fill="#FFFFFF" height="191.7969" style="stroke:#181818;stroke-width:1.0;" width="10" x="156" y="204.125"/><rect fill="#FFFFFF" height="120.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="161" y="246.2578"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="303.5234"/><rect fill="#FFFFFF" height="821.4531" style="stroke:#181818;stroke-width:1.0;" width="10" x="156" y="476.1875"/><rect fill="#FFBBBB" height="423.9922" style="stroke:#181818;stroke-width:1.0;" width="10" x="161" y="850.6484"/><rect fill="#FFFFFF" height="99.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="892.7813"/><rect fill="#FFFFFF" height="223.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="1051.5781"/><rect fill="#C0C0C0" height="156.7969" style="stroke:#181818;stroke-width:1.0;" width="10" x="171" y="1117.8438"/><rect fill="#FFFFFF" height="131.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="587" y="539.4531"/><rect fill="#FFFFFF" height="64.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="592" y="606.8516"/><rect fill="#FFFFFF" height="172.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="640.9844"/><rect fill="#FFFFFF" height="105.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="815" y="708.1172"/><rect fill="#FFFFFF" height="63.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="820" y="750.25"/><rect fill="#FFFFFF" height="65.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="926.9141"/><rect fill="#FFFFFF" height="65.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="1209.2422"/><rect fill="none" height="218.0625" style="stroke:#000000;stroke-width:1.5;" width="896.5" x="88.5" y="1071.5781"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="160.5" x2="160.5" y1="36.2969" y2="1306.6406"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="437" x2="437" y1="121.2109" y2="1306.6406"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="592" x2="592" y1="36.2969" y2="1306.6406"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="814.5" x2="814.5" y1="36.2969" y2="1306.6406"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="125" x="98.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="105.5" y="24.9951">GestureBinding</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="125" x="98.5" y="1305.6406"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="105.5" y="1325.6357">GestureBinding</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="112" x="381" y="1305.6406"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="98" x="388" y="1325.6357">HitTestResult</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="178" x="503" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="164" x="510" y="24.9951">RenderPointerListener</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="178" x="503" y="1305.6406"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="164" x="510" y="1325.6357">RenderPointerListener</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="179" x="725.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="165" x="732.5" y="24.9951">TapGestureRecognizer</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="179" x="725.5" y="1305.6406"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="165" x="732.5" y="1325.6357">TapGestureRecognizer</text><rect fill="#FFFFFF" height="191.7969" style="stroke:#181818;stroke-width:1.0;" width="10" x="156" y="204.125"/><rect fill="#FFFFFF" height="120.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="161" y="246.2578"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="303.5234"/><rect fill="#FFFFFF" height="821.4531" style="stroke:#181818;stroke-width:1.0;" width="10" x="156" y="476.1875"/><rect fill="#FFBBBB" height="423.9922" style="stroke:#181818;stroke-width:1.0;" width="10" x="161" y="850.6484"/><rect fill="#FFFFFF" height="99.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="892.7813"/><rect fill="#FFFFFF" height="223.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="166" y="1051.5781"/><rect fill="#C0C0C0" height="156.7969" style="stroke:#181818;stroke-width:1.0;" width="10" x="171" y="1117.8438"/><rect fill="#FFFFFF" height="131.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="587" y="539.4531"/><rect fill="#FFFFFF" height="64.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="592" y="606.8516"/><rect fill="#FFFFFF" height="172.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="640.9844"/><rect fill="#FFFFFF" height="105.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="815" y="708.1172"/><rect fill="#FFFFFF" height="63.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="820" y="750.25"/><rect fill="#FFFFFF" height="65.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="926.9141"/><rect fill="#FFFFFF" height="65.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="810" y="1209.2422"/><ellipse cx="7.5" cy="81.8125" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="149,78.5625,159,82.5625,149,86.5625,153,82.5625" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="155" y1="82.5625" y2="82.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="125" x="15" y="62.3638">handlePointerEvent</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="129" x="15" y="77.4966">(PointerDownEvent)</text><polygon fill="#181818" points="369,107.6953,379,111.6953,369,115.6953,373,111.6953" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="161" x2="375" y1="111.6953" y2="111.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="27" x="168" y="106.6294">new</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="112" x="381" y="90.5625"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="98" x="388" y="110.5576">HitTestResult</text><rect fill="#EEEEEE" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1028" x="0" y="152.4258"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1028" y1="152.4258" y2="152.4258"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1028" y1="155.4258" y2="155.4258"/><rect fill="#EEEEEE" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="137" x="445.5" y="141.8594"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="118" x="451.5" y="157.9263">&#21629;&#20013;&#27979;&#35797; hitTest</text><line style="stroke:#181818;stroke-width:1.0;" x1="161" x2="208" y1="191.125" y2="191.125"/><line style="stroke:#181818;stroke-width:1.0;" x1="208" x2="208" y1="191.125" y2="204.125"/><line style="stroke:#181818;stroke-width:1.0;" x1="167" x2="208" y1="204.125" y2="204.125"/><polygon fill="#181818" points="177,200.125,167,204.125,177,208.125,173,204.125" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="163" x="173" y="186.0591">(RendererBinding).hitTest</text><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="213" y1="233.2578" y2="233.2578"/><line style="stroke:#181818;stroke-width:1.0;" x1="213" x2="213" y1="233.2578" y2="246.2578"/><line style="stroke:#181818;stroke-width:1.0;" x1="172" x2="213" y1="246.2578" y2="246.2578"/><polygon fill="#181818" points="182,242.2578,172,246.2578,182,250.2578,178,246.2578" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="121" x="178" y="228.1919">renderView.hitTest</text><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="218" y1="290.5234" y2="290.5234"/><line style="stroke:#181818;stroke-width:1.0;" x1="218" x2="218" y1="290.5234" y2="303.5234"/><line style="stroke:#181818;stroke-width:1.0;" x1="177" x2="218" y1="303.5234" y2="303.5234"/><polygon fill="#181818" points="187,299.5234,177,303.5234,187,307.5234,183,303.5234" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="82" x="183" y="270.3247">child!.hitTest</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="104" x="183" y="285.4575">&#28145;&#24230;&#20248;&#20808;&#36941;&#21382;&#23376;&#26641;</text><polygon fill="#181818" points="425,333.6563,435,337.6563,425,341.6563,429,337.6563" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="431" y1="337.6563" y2="337.6563"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="195" x="178" y="332.5903">add(&#21629;&#20013;&#27979;&#35797;&#36890;&#36807;&#30340;RenderBox)</text><polygon fill="#181818" points="425,362.7891,435,366.7891,425,370.7891,429,366.7891" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="431" y1="366.7891" y2="366.7891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="227" x="173" y="361.7231">add(HitTestEntry(RenderView.this))</text><polygon fill="#181818" points="425,391.9219,435,395.9219,425,399.9219,429,395.9219" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="161" x2="431" y1="395.9219" y2="395.9219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="247" x="168" y="390.856">add(HitTestEntry(GestureBinding.this))</text><rect fill="#EEEEEE" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1028" x="0" y="424.4883"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1028" y1="424.4883" y2="424.4883"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1028" y1="427.4883" y2="427.4883"/><rect fill="#EEEEEE" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="143" x="442.5" y="413.9219"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="124" x="448.5" y="429.9888">&#28857;&#20987;down&#20107;&#20214;&#20998;&#21457;</text><line style="stroke:#181818;stroke-width:1.0;" x1="161" x2="208" y1="463.1875" y2="463.1875"/><line style="stroke:#181818;stroke-width:1.0;" x1="208" x2="208" y1="463.1875" y2="476.1875"/><line style="stroke:#181818;stroke-width:1.0;" x1="167" x2="208" y1="476.1875" y2="476.1875"/><polygon fill="#181818" points="177,472.1875,167,476.1875,177,480.1875,173,476.1875" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="91" x="173" y="458.1216">dispatchEvent</text><polygon fill="#181818" points="425,506.3203,435,510.3203,425,514.3203,429,510.3203" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="431" y1="510.3203" y2="510.3203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="156" x="173" y="505.2544">&#33719;&#21462;&#21629;&#20013;&#27979;&#35797;&#30340;target&#21015;&#34920;</text><polygon fill="#181818" points="575,535.4531,585,539.4531,575,543.4531,579,539.4531" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="581" y1="539.4531" y2="539.4531"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="173" y="534.3872">handleEvent</text><line style="stroke:#181818;stroke-width:1.0;" x1="597" x2="644" y1="593.8516" y2="593.8516"/><line style="stroke:#181818;stroke-width:1.0;" x1="644" x2="644" y1="593.8516" y2="606.8516"/><line style="stroke:#181818;stroke-width:1.0;" x1="603" x2="644" y1="606.8516" y2="606.8516"/><polygon fill="#181818" points="613,602.8516,603,606.8516,613,610.8516,609,606.8516" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="177" x="609" y="558.52">onPointerDown?.call(event)</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="199" x="609" y="573.6528">&#23545;&#24212;RawGestureDetectorState.</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="132" x="609" y="588.7856">_handlePointerDown</text><polygon fill="#181818" points="798,636.9844,808,640.9844,798,644.9844,802,640.9844" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="602" x2="804" y1="640.9844" y2="640.9844"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="116" x="609" y="635.9185">addPointer(event)</text><line style="stroke:#181818;stroke-width:1.0;" x1="820" x2="867" y1="695.1172" y2="695.1172"/><line style="stroke:#181818;stroke-width:1.0;" x1="867" x2="867" y1="695.1172" y2="708.1172"/><line style="stroke:#181818;stroke-width:1.0;" x1="826" x2="867" y1="708.1172" y2="708.1172"/><polygon fill="#181818" points="836,704.1172,826,708.1172,836,712.1172,832,708.1172" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="166" x="832" y="690.0513">addAllowedPointer(event)</text><line style="stroke:#181818;stroke-width:1.0;" x1="825" x2="872" y1="737.25" y2="737.25"/><line style="stroke:#181818;stroke-width:1.0;" x1="872" x2="872" y1="737.25" y2="750.25"/><line style="stroke:#181818;stroke-width:1.0;" x1="831" x2="872" y1="750.25" y2="750.25"/><polygon fill="#181818" points="841,746.25,831,750.25,841,754.25,837,750.25" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="184" x="837" y="732.1841">startTrackingPointer(pointer)</text><polygon fill="#181818" points="177,780.3828,167,784.3828,177,788.3828,173,784.3828" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="819" y1="784.3828" y2="784.3828"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="236" x="183" y="779.3169">pointerRouter.addRoute &#21152;&#20837;&#21040;&#36335;&#30001;&#20013;</text><polygon fill="#181818" points="177,809.5156,167,813.5156,177,817.5156,173,813.5156" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="814" y1="813.5156" y2="813.5156"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="309" x="183" y="808.4497">gestureArena.add(pointer, this) &#28155;&#21152;&#21040;&#20107;&#20214;&#31454;&#25216;&#22330;</text><line style="stroke:#181818;stroke-width:1.0;" x1="166" x2="213" y1="837.6484" y2="837.6484"/><line style="stroke:#181818;stroke-width:1.0;" x1="213" x2="213" y1="837.6484" y2="850.6484"/><line style="stroke:#181818;stroke-width:1.0;" x1="172" x2="213" y1="850.6484" y2="850.6484"/><polygon fill="#181818" points="182,846.6484,172,850.6484,182,854.6484,178,850.6484" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="178" y="832.5825">handleEvent</text><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="218" y1="879.7813" y2="879.7813"/><line style="stroke:#181818;stroke-width:1.0;" x1="218" x2="218" y1="879.7813" y2="892.7813"/><line style="stroke:#181818;stroke-width:1.0;" x1="177" x2="218" y1="892.7813" y2="892.7813"/><polygon fill="#181818" points="187,888.7813,177,892.7813,187,896.7813,183,892.7813" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="173" x="183" y="874.7153">pointerRouter.route(event)</text><polygon fill="#181818" points="798,922.9141,808,926.9141,798,930.9141,802,926.9141" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="176" x2="804" y1="926.9141" y2="926.9141"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="183" y="921.8481">handleEvent</text><line style="stroke:#181818;stroke-width:1.0;" x1="820" x2="862" y1="991.3125" y2="991.3125"/><line style="stroke:#181818;stroke-width:1.0;" x1="862" x2="862" y1="991.3125" y2="1004.3125"/><line style="stroke:#181818;stroke-width:1.0;" x1="815" x2="862" y1="1004.3125" y2="1004.3125"/><polygon fill="#181818" points="825,1000.3125,815,1004.3125,825,1008.3125,821,1004.3125" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="169" x="827" y="955.981">&#27491;&#24120;&#25353;&#38190;&#25353;&#19979;&#30340;&#24773;&#20917;&#26080;&#25805;&#20316;&#12290;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="169" x="827" y="971.1138">&#22312;&#35302;&#25720;&#28857;&#31227;&#20986;&#25353;&#38190;&#21306;&#22495;&#31561;&#29305;&#27530;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="117" x="827" y="986.2466">&#24773;&#20917;&#20250;&#20570;&#28165;&#29702;&#25805;&#20316;&#12290;</text><line style="stroke:#181818;stroke-width:1.0;" x1="171" x2="218" y1="1038.5781" y2="1038.5781"/><line style="stroke:#181818;stroke-width:1.0;" x1="218" x2="218" y1="1038.5781" y2="1051.5781"/><line style="stroke:#181818;stroke-width:1.0;" x1="177" x2="218" y1="1051.5781" y2="1051.5781"/><polygon fill="#181818" points="187,1047.5781,177,1051.5781,187,1055.5781,183,1051.5781" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="124" x="183" y="1018.3794">gestureArena.close</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="130" x="183" y="1033.5122">&#38459;&#27490;&#26032;&#20107;&#20214;&#31454;&#20105;&#32773;&#21152;&#20837;</text><path d="M88.5,1071.5781 L287.5,1071.5781 L287.5,1078.7109 L277.5,1088.7109 L88.5,1088.7109 L88.5,1071.5781 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="218.0625" style="stroke:#000000;stroke-width:1.5;" width="896.5" x="88.5" y="1071.5781"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="154" x="103.5" y="1084.645">&#21482;&#26377;&#19968;&#20010;&#31454;&#20105;&#32773;&#25165;&#20250;&#25191;&#34892;</text><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="176" x2="223" y1="1104.8438" y2="1104.8438"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="223" x2="223" y1="1104.8438" y2="1117.8438"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="182" x2="223" y1="1117.8438" y2="1117.8438"/><polygon fill="#181818" points="192,1113.8438,182,1117.8438,192,1121.8438,188,1117.8438" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="117" x="188" y="1099.7778">scheduleMicrotask</text><line style="stroke:#181818;stroke-width:1.0;" x1="181" x2="223" y1="1167.1094" y2="1167.1094"/><line style="stroke:#181818;stroke-width:1.0;" x1="223" x2="223" y1="1167.1094" y2="1180.1094"/><line style="stroke:#181818;stroke-width:1.0;" x1="182" x2="223" y1="1180.1094" y2="1180.1094"/><polygon fill="#181818" points="192,1176.1094,182,1180.1094,192,1184.1094,188,1180.1094" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="144" x="188" y="1146.9106">GestureArenaManager</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="164" x="188" y="1162.0435">&#21024;&#38500;pointer id&#23545;&#24212;&#30340;&#31454;&#25216;&#22330;</text><polygon fill="#181818" points="798,1205.2422,808,1209.2422,798,1213.2422,802,1209.2422" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="181" x2="804" y1="1209.2422" y2="1209.2422"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="169" x="188" y="1204.1763">&#160;&#160;&#160;&#160;&#160;acceptGesture(pointer)</text><line style="stroke:#181818;stroke-width:1.0;" x1="820" x2="862" y1="1273.6406" y2="1273.6406"/><line style="stroke:#181818;stroke-width:1.0;" x1="862" x2="862" y1="1273.6406" y2="1286.6406"/><line style="stroke:#181818;stroke-width:1.0;" x1="815" x2="862" y1="1286.6406" y2="1286.6406"/><polygon fill="#181818" points="825,1282.6406,815,1286.6406,825,1290.6406,821,1286.6406" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="143" x="827" y="1238.3091">&#21807;&#19968;&#30340;&#31454;&#20105;&#32773;&#27492;&#26102;&#24182;&#19981;&#20250;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="143" x="827" y="1253.4419">&#31435;&#21051;&#35302;&#21457;&#28857;&#20987;&#20107;&#20214;&#22238;&#35843;&#65292;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="146" x="827" y="1268.5747">&#32780;&#26159;&#31561;&#24453;up&#20107;&#20214;&#30340;&#21040;&#26469;&#12290;</text><!--SRC=[fLLRJnf167tdLsnZqe1MOr_wO8EDraiVQj9GqvUID9lT2MpSp9BTGTe-uGK5nLjgrLBhfVKM3Q8FAXTjVqntPfUd_eKEkuC2Be8j9BCmEz-PC-SxtpTlbVRkGQ2Xi0fw9IXACC1rSK4UYZ9ufKWG0RL_543aXsxsjq-9G6lAuwg9Q-_cNaXec4xwW1QM4TVQIh4WYBXSNY-7bwxqR9gSpPgPprpGNiTvlGuWDJDjRLsSsmUW25IWiabF1qDeBborejz887A_E24eoUA3SemVaejJdD_JBzTmB5uScyFpKpYzIBQM6YdHnV6YwAvKe1XDcR-cZTIaVR1UvRt79G9UGD8eZq0DbuP2jxVREx3PVeZK3qmowz0eA6cUnlbo0AaEAGFTGRMKQcCyXwSB8ZMAdf_L2-SuFeKNbffEjYXf8Hu9GSjbJP0svo_mmagbkbHNnAi1W71yrTm-SC2mnM6MVYbf242WMhlRthVtTbvrPxW2A-haMOV0ox8RMENYXpYJm_bb7nzXVFe00W9IrDU82jdXX- -gwgu4K9_1C1zYA3uWA04eVMG4Q0hPShPlPR8SuHelSDoi0OaUMLOYe9RBlP4qcaWqhFB22CrS6InaF-l3tUfeBCAdXEdOGUbPlpWyiuLZkpX-ObvaZELJQg3c8GFsH0zjBdm9iSpg4MTL2KSk2YNu-8bT1CRH1fc9ulLyfTnEc_tt-uP5LctoEfNCjGmCzD9FSpLRhQzQUfHJVZk-Rh8hQTtBAQK6ID8_S3PBaedYyZ4TzUmiRGDa8eQdpiZg5laqfr-j_uwEqp9SFp3tzyXIblOfOx-0f_Ds44xcyUQcaKuOYHmvdg7jtWhMBrDuB4MoCMDnwXhbNitQGQygymYoeW4_BAuLIFexMRanZ9vFcD6ORLBE5Q2oXZYyS4ZMwUcYUlRmUWb9p56Q9B5lRYTl4N0oW2O4WHYMmP0ag0hYjP7wDdZUMVesuwh1YaCDyP0F09Mg7TygVjbX_k0aqMw2D3Kt1U50kAv57hOyVjBvjDx82m888HRPk4tKzH9Upb25RP9CuVGEMJt7kNCzMvBQ3usZMHmlK2FHgys-yDXbztN3F9duSvdqGpEQ96iPQYZyCnOEiQoc9cbB8DzsxpRHlxoXhVil]--></g></svg>

<h3 id="命中测试-hitTest"><a href="#命中测试-hitTest" class="headerlink" title="命中测试 hitTest"></a>命中测试 hitTest</h3><p>一次点击事件发生后，会首先进行命中测试。</p>
<p>命中测试hitTest在PointerDownEvent事件的处理流程中进行，从<code>RendererBinding.hitTest</code>开始，然后调用<code>GestureBinding.hitTest</code>，再调用<code>RenderView.hitTest</code>，RenderView会直接调用子节点的hitTest。（其实RendererBinding和GestureBinding都是对应一个WidgetsFlutterBinding类实例，属于继承关系。）RenderView的子节点是RenderBox的子类，从此之后，参与命中测试的组件都是RenderBox或者其子类。hitTest的默认处理逻辑在RenderBox中实现：</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">abstract</span> <span class="class"><span class="keyword">class</span> <span class="title">RenderBox</span> <span class="keyword">extends</span> <span class="title">RenderObject</span> </span>&#123;</span><br><span class="line">  <span class="built_in">bool</span> hitTest(BoxHitTestResult result, &#123; <span class="keyword">required</span> Offset position &#125;) &#123;</span><br><span class="line">    <span class="keyword">if</span> (_size!.contains(position)) &#123;</span><br><span class="line">      <span class="keyword">if</span> (hitTestChildren(result, position: position) || hitTestSelf(position)) &#123;</span><br><span class="line">        result.add(BoxHitTestEntry(<span class="keyword">this</span>, position));</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">true</span>;</span><br><span class="line">      &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> <span class="keyword">false</span>;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>处理逻辑解读：</p>
<ul>
<li>先判断点击的坐标是否在控件范围内，如果在，则表示命中测试，否则就返回，不会再对子节点进行命中测试；</li>
<li>执行hitTestChildren判断子节点是否命中测试，如果命中就加入到HitTestResult中；</li>
<li>最后把自己加入到HitTestResult中。</li>
</ul>
<p>因此，hitTest采用深度优先遍历算法，先将最内部的子节点加入到HitTestResult中，最后再加入自己。命中测试会把点击坐标位置的控件都加入到命中列表中，并没有区分是否是可点击控件。</p>
<h3 id="hitTestChildren"><a href="#hitTestChildren" class="headerlink" title="hitTestChildren"></a>hitTestChildren</h3><p>RenderBox的hitTestChildren默认实现始终返回false，RenderBox子类需要自己来实现。对于RenderProxyBox，方法在<code>RenderProxyBoxMixin</code>中实现：</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@override</span></span><br><span class="line"><span class="built_in">bool</span> hitTestChildren(BoxHitTestResult result, &#123; <span class="keyword">required</span> Offset position &#125;) &#123;</span><br><span class="line">  <span class="keyword">return</span> child?.hitTest(result, position: position) ?? <span class="keyword">false</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>代码解读：</p>
<p><code>hitTestChildren</code>会直接调用子节点的hitTest，如果没有子节点就返回false，表示节点没有命中测试。</p>
<p>对于具有多个子节点的RenderObject，比如Column等，处理逻辑在<code>RenderCustomMultiChildLayoutBox.hitTestChildren</code>中，会使用倒序的方式调用child的hitTest。很多继承自RenderObject的子类都有自己的实现，比如RenderCustomPaint、RenderFittedBox、RenderFlex等。</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">bool</span> defaultHitTestChildren(BoxHitTestResult result, &#123; <span class="keyword">required</span> Offset position &#125;) &#123;</span><br><span class="line">  ChildType? child = lastChild;  <span class="comment">//采用倒序，优先命中测试lastChild</span></span><br><span class="line">  <span class="keyword">while</span> (child != <span class="keyword">null</span>) &#123;</span><br><span class="line">    <span class="keyword">final</span> ParentDataType childParentData = child.parentData! <span class="keyword">as</span> ParentDataType;</span><br><span class="line">    <span class="keyword">final</span> <span class="built_in">bool</span> isHit = result.addWithPaintOffset(</span><br><span class="line">      offset: childParentData.offset,</span><br><span class="line">      position: position,</span><br><span class="line">      hitTest: (BoxHitTestResult result, Offset? transformed) &#123;</span><br><span class="line">        <span class="keyword">assert</span>(transformed == position - childParentData.offset);</span><br><span class="line">        <span class="keyword">return</span> child!.hitTest(result, position: transformed!);</span><br><span class="line">      &#125;,</span><br><span class="line">    );</span><br><span class="line">    <span class="keyword">if</span> (isHit)</span><br><span class="line">      <span class="keyword">return</span> <span class="keyword">true</span>;</span><br><span class="line">    child = childParentData.previousSibling;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="keyword">return</span> <span class="keyword">false</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="点击事件分发"><a href="#点击事件分发" class="headerlink" title="点击事件分发"></a>点击事件分发</h3><p>命中测试完成后，就会执行down事件的分发，事件会分发给命中测试列表中的各个<code>RenderBox</code>，执行<code>RenderBox.handleEvent</code>函数。默认的handleEvent实现是空实现。GestureDetector会通过<code>RenderPointerListener</code>来处理按键。具体流程可以参考上面的时序图。</p>
<p>经过事件分发后，只有真正的点击事件处理组件才会被加入到事件路由和事件竞技场中。</p>
<h2 id="PointerUpEvent（抬起）事件处理流程"><a href="#PointerUpEvent（抬起）事件处理流程" class="headerlink" title="PointerUpEvent（抬起）事件处理流程"></a>PointerUpEvent（抬起）事件处理流程</h2><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="1081px" preserveAspectRatio="none" style="width:851px;height:1081px;background:#FFFFFF;" version="1.1" viewBox="0 0 851 1081" width="851px" zoomAndPan="magnify"><defs/><g><rect fill="#FFFFFF" height="875.6641" style="stroke:#181818;stroke-width:1.0;" width="10" x="152" y="161.8281"/><rect fill="#FFBBBB" height="702" style="stroke:#181818;stroke-width:1.0;" width="10" x="157" y="335.4922"/><rect fill="#FFFFFF" height="334.1953" style="stroke:#181818;stroke-width:1.0;" width="10" x="162" y="377.625"/><rect fill="#FFFFFF" height="287.5391" style="stroke:#181818;stroke-width:1.0;" width="10" x="162" y="748.9531"/><rect fill="#FFFFFF" height="95.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="392" y="195.9609"/><rect fill="#FFFFFF" height="28" style="stroke:#181818;stroke-width:1.0;" width="10" x="397" y="263.3594"/><rect fill="#FFFFFF" height="300.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="588" y="411.7578"/><rect fill="#FFFFFF" height="135.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="593" y="448.8906"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="598" y="515.1563"/><rect fill="#FFFFFF" height="76.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="593" y="635.5547"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="598" y="677.6875"/><rect fill="#FFFFFF" height="106.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="588" y="822.0234"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="593" y="859.1563"/><rect fill="#FFFFFF" height="35.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="588" y="979.3594"/><rect fill="none" height="130.5313" style="stroke:#000000;stroke-width:1.5;" width="318.5" x="493.5" y="468.8906"/><rect fill="none" height="260.5391" style="stroke:#000000;stroke-width:1.5;" width="722.5" x="84.5" y="768.9531"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="156.5" x2="156.5" y1="36.2969" y2="1046.4922"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="397" x2="397" y1="36.2969" y2="1046.4922"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="592.5" x2="592.5" y1="36.2969" y2="1046.4922"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="125" x="94.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="101.5" y="24.9951">GestureBinding</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="125" x="94.5" y="1045.4922"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="101.5" y="1065.4873">GestureBinding</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="178" x="308" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="164" x="315" y="24.9951">RenderPointerListener</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="178" x="308" y="1045.4922"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="164" x="315" y="1065.4873">RenderPointerListener</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="179" x="503.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="165" x="510.5" y="24.9951">TapGestureRecognizer</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="179" x="503.5" y="1045.4922"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="165" x="510.5" y="1065.4873">TapGestureRecognizer</text><rect fill="#FFFFFF" height="875.6641" style="stroke:#181818;stroke-width:1.0;" width="10" x="152" y="161.8281"/><rect fill="#FFBBBB" height="702" style="stroke:#181818;stroke-width:1.0;" width="10" x="157" y="335.4922"/><rect fill="#FFFFFF" height="334.1953" style="stroke:#181818;stroke-width:1.0;" width="10" x="162" y="377.625"/><rect fill="#FFFFFF" height="287.5391" style="stroke:#181818;stroke-width:1.0;" width="10" x="162" y="748.9531"/><rect fill="#FFFFFF" height="95.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="392" y="195.9609"/><rect fill="#FFFFFF" height="28" style="stroke:#181818;stroke-width:1.0;" width="10" x="397" y="263.3594"/><rect fill="#FFFFFF" height="300.0625" style="stroke:#181818;stroke-width:1.0;" width="10" x="588" y="411.7578"/><rect fill="#FFFFFF" height="135.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="593" y="448.8906"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="598" y="515.1563"/><rect fill="#FFFFFF" height="76.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="593" y="635.5547"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="598" y="677.6875"/><rect fill="#FFFFFF" height="106.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="588" y="822.0234"/><rect fill="#FFFFFF" height="34.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="593" y="859.1563"/><rect fill="#FFFFFF" height="35.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="588" y="979.3594"/><ellipse cx="7.5" cy="81.8125" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="145,78.5625,155,82.5625,145,86.5625,149,82.5625" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="151" y1="82.5625" y2="82.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="125" x="15" y="62.3638">handlePointerEvent</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="109" x="15" y="77.4966">(PointerUpEvent)</text><line style="stroke:#181818;stroke-width:1.0;" x1="157" x2="199" y1="111.6953" y2="111.6953"/><line style="stroke:#181818;stroke-width:1.0;" x1="199" x2="199" y1="111.6953" y2="124.6953"/><line style="stroke:#181818;stroke-width:1.0;" x1="158" x2="199" y1="124.6953" y2="124.6953"/><polygon fill="#181818" points="168,120.6953,158,124.6953,168,128.6953,164,124.6953" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="104" x="164" y="106.6294">&#21024;&#38500;&#21629;&#20013;&#27979;&#35797;&#32467;&#26524;</text><line style="stroke:#181818;stroke-width:1.0;" x1="157" x2="204" y1="148.8281" y2="148.8281"/><line style="stroke:#181818;stroke-width:1.0;" x1="204" x2="204" y1="148.8281" y2="161.8281"/><line style="stroke:#181818;stroke-width:1.0;" x1="163" x2="204" y1="161.8281" y2="161.8281"/><polygon fill="#181818" points="173,157.8281,163,161.8281,173,165.8281,169,161.8281" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="91" x="169" y="143.7622">dispatchEvent</text><polygon fill="#181818" points="380,191.9609,390,195.9609,380,199.9609,384,195.9609" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="162" x2="386" y1="195.9609" y2="195.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="169" y="190.895">handleEvent</text><line style="stroke:#181818;stroke-width:1.0;" x1="407" x2="449" y1="255.3594" y2="255.3594"/><line style="stroke:#181818;stroke-width:1.0;" x1="449" x2="449" y1="255.3594" y2="268.3594"/><line style="stroke:#181818;stroke-width:1.0;" x1="408" x2="449" y1="268.3594" y2="268.3594"/><polygon fill="#181818" points="418,264.3594,408,268.3594,418,272.3594,414,268.3594" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="157" x="414" y="220.0278">onPointerUp?.call(event)</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="172" x="414" y="235.1606">&#22312;GestureDetector&#30340;&#22330;&#26223;&#65292;</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="113" x="414" y="250.2935">onPointerUp&#20026;null</text><line style="stroke:#181818;stroke-width:1.0;" x1="162" x2="209" y1="322.4922" y2="322.4922"/><line style="stroke:#181818;stroke-width:1.0;" x1="209" x2="209" y1="322.4922" y2="335.4922"/><line style="stroke:#181818;stroke-width:1.0;" x1="168" x2="209" y1="335.4922" y2="335.4922"/><polygon fill="#181818" points="178,331.4922,168,335.4922,178,339.4922,174,335.4922" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="174" y="317.4263">handleEvent</text><line style="stroke:#181818;stroke-width:1.0;" x1="167" x2="214" y1="364.625" y2="364.625"/><line style="stroke:#181818;stroke-width:1.0;" x1="214" x2="214" y1="364.625" y2="377.625"/><line style="stroke:#181818;stroke-width:1.0;" x1="173" x2="214" y1="377.625" y2="377.625"/><polygon fill="#181818" points="183,373.625,173,377.625,183,381.625,179,377.625" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="126" x="179" y="359.5591">pointerRouter.route</text><polygon fill="#181818" points="576,407.7578,586,411.7578,576,415.7578,580,411.7578" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="172" x2="582" y1="411.7578" y2="411.7578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="80" x="179" y="406.6919">handleEvent</text><line style="stroke:#181818;stroke-width:1.0;" x1="598" x2="645" y1="435.8906" y2="435.8906"/><line style="stroke:#181818;stroke-width:1.0;" x1="645" x2="645" y1="435.8906" y2="448.8906"/><line style="stroke:#181818;stroke-width:1.0;" x1="604" x2="645" y1="448.8906" y2="448.8906"/><polygon fill="#181818" points="614,444.8906,604,448.8906,614,452.8906,610,448.8906" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="138" x="610" y="430.8247">handlePrimaryPointer</text><path d="M493.5,468.8906 L706.5,468.8906 L706.5,476.0234 L696.5,486.0234 L493.5,486.0234 L493.5,468.8906 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="130.5313" style="stroke:#000000;stroke-width:1.5;" width="318.5" x="493.5" y="468.8906"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="168" x="508.5" y="481.9575">&#21482;&#26377;&#19968;&#20010;&#31454;&#20105;&#32773;&#26102;&#25165;&#20250;&#25191;&#34892;</text><line style="stroke:#181818;stroke-width:1.0;" x1="603" x2="650" y1="502.1563" y2="502.1563"/><line style="stroke:#181818;stroke-width:1.0;" x1="650" x2="650" y1="502.1563" y2="515.1563"/><line style="stroke:#181818;stroke-width:1.0;" x1="609" x2="650" y1="515.1563" y2="515.1563"/><polygon fill="#181818" points="619,511.1563,609,515.1563,619,519.1563,615,515.1563" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="84" x="615" y="497.0903">handleTapUp</text><ellipse cx="841.5" cy="548.5391" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="824.5,545.2891,834.5,549.2891,824.5,553.2891,828.5,549.2891" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="603" x2="830.5" y1="549.2891" y2="549.2891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="188" x="610" y="544.2231">onTap &#20351;&#29992;&#32773;&#25509;&#25910;&#21040;onTap&#20107;&#20214;</text><line style="stroke:#181818;stroke-width:1.0;" x1="603" x2="645" y1="583.4219" y2="583.4219"/><line style="stroke:#181818;stroke-width:1.0;" x1="645" x2="645" y1="583.4219" y2="596.4219"/><line style="stroke:#181818;stroke-width:1.0;" x1="598" x2="645" y1="596.4219" y2="596.4219"/><polygon fill="#181818" points="608,592.4219,598,596.4219,608,600.4219,604,596.4219" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="40" x="610" y="578.356">_reset</text><line style="stroke:#181818;stroke-width:1.0;" x1="598" x2="645" y1="622.5547" y2="622.5547"/><line style="stroke:#181818;stroke-width:1.0;" x1="645" x2="645" y1="622.5547" y2="635.5547"/><line style="stroke:#181818;stroke-width:1.0;" x1="604" x2="645" y1="635.5547" y2="635.5547"/><polygon fill="#181818" points="614,631.5547,604,635.5547,614,639.5547,610,635.5547" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="233" x="610" y="617.4888">stopTrackingIfPointerNoLongerDown</text><line style="stroke:#181818;stroke-width:1.0;" x1="603" x2="650" y1="664.6875" y2="664.6875"/><line style="stroke:#181818;stroke-width:1.0;" x1="650" x2="650" y1="664.6875" y2="677.6875"/><line style="stroke:#181818;stroke-width:1.0;" x1="609" x2="650" y1="677.6875" y2="677.6875"/><polygon fill="#181818" points="619,673.6875,609,677.6875,619,681.6875,615,677.6875" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="127" x="615" y="659.6216">stopTrackingPointer</text><polygon fill="#181818" points="178,707.8203,168,711.8203,178,715.8203,174,711.8203" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="172" x2="592" y1="711.8203" y2="711.8203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="180" x="184" y="706.7544">pointerRouter.removeRoute</text><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="167" x2="214" y1="735.9531" y2="735.9531"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="214" x2="214" y1="735.9531" y2="748.9531"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="173" x2="214" y1="748.9531" y2="748.9531"/><polygon fill="#181818" points="183,744.9531,173,748.9531,183,752.9531,179,748.9531" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="211" x="179" y="730.8872">gestureArena.sweep&#22788;&#29702;&#31454;&#25216;&#36923;&#36753;</text><path d="M84.5,768.9531 L150.5,768.9531 L150.5,776.0859 L140.5,786.0859 L84.5,786.0859 L84.5,768.9531 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="260.5391" style="stroke:#000000;stroke-width:1.5;" width="722.5" x="84.5" y="768.9531"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="21" x="99.5" y="782.02">alt</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="175" x="165.5" y="781.1636">[&#23384;&#22312;&#22810;&#20010;&#31454;&#20105;&#32773;&#65292;&#21017;&#25191;&#34892;&#31454;&#25216;&#27969;&#31243;]</text><line style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="84.5" x2="807" y1="787.0859" y2="787.0859"/><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="54" x="89.5" y="797.2964">[&#31454;&#25216;&#32988;&#20986;]</text><polygon fill="#181818" points="576,818.0234,586,822.0234,576,826.0234,580,822.0234" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="172" x2="582" y1="822.0234" y2="822.0234"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="94" x="179" y="816.9575">acceptGesture</text><line style="stroke:#181818;stroke-width:1.0;" x1="598" x2="645" y1="846.1563" y2="846.1563"/><line style="stroke:#181818;stroke-width:1.0;" x1="645" x2="645" y1="846.1563" y2="859.1563"/><line style="stroke:#181818;stroke-width:1.0;" x1="604" x2="645" y1="859.1563" y2="859.1563"/><polygon fill="#181818" points="614,855.1563,604,859.1563,614,863.1563,610,859.1563" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="84" x="610" y="841.0903">handleTapUp</text><ellipse cx="841.5" cy="892.5391" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="824.5,889.2891,834.5,893.2891,824.5,897.2891,828.5,893.2891" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="598" x2="830.5" y1="893.2891" y2="893.2891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="188" x="605" y="888.2231">onTap &#20351;&#29992;&#32773;&#25509;&#25910;&#21040;onTap&#20107;&#20214;</text><line style="stroke:#181818;stroke-width:1.0;" x1="598" x2="640" y1="927.4219" y2="927.4219"/><line style="stroke:#181818;stroke-width:1.0;" x1="640" x2="640" y1="927.4219" y2="940.4219"/><line style="stroke:#181818;stroke-width:1.0;" x1="593" x2="640" y1="940.4219" y2="940.4219"/><polygon fill="#181818" points="603,936.4219,593,940.4219,603,944.4219,599,940.4219" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="40" x="605" y="922.356">_reset</text><line style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="84.5" x2="807" y1="944.4219" y2="944.4219"/><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="54" x="89.5" y="954.6323">[&#31454;&#25216;&#22833;&#36133;]</text><polygon fill="#181818" points="576,975.3594,586,979.3594,576,983.3594,580,979.3594" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="172" x2="582" y1="979.3594" y2="979.3594"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="87" x="179" y="974.2935">rejectGesture</text><line style="stroke:#181818;stroke-width:1.0;" x1="598" x2="640" y1="1013.4922" y2="1013.4922"/><line style="stroke:#181818;stroke-width:1.0;" x1="640" x2="640" y1="1013.4922" y2="1026.4922"/><line style="stroke:#181818;stroke-width:1.0;" x1="593" x2="640" y1="1026.4922" y2="1026.4922"/><polygon fill="#181818" points="603,1022.4922,593,1026.4922,603,1030.4922,599,1026.4922" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="40" x="605" y="1008.4263">_reset</text><!--SRC=[jLHVQzDG57_FfxZWosIq7w0F4yUS24D6sPwio2KvPj7itd1psw5F5QUsTluPJhIb38KEosHCmPNIRlfbSfFioQ_WRH9BR5FRJCn3mZtd_iwVt_cTtAAPXUjWyoA3HODe1j5H3crWefcmIWt2WLqh0U45CXSTrwt0S1af8x3C0XeB92eVpkijiNlcT8_Savf__DRhlt7tczEny_Cvf1csXRcw4IHCWEI1QC2YkbOCcmC15Y331a9Sygs_m3EP7A9asEwLh8fDSmw2hWj4DDjH9Kl0GUMKUOrjqUovzUEVfpi54aCwtHufcgQY0LQvKS8SadFEmcIyes6qaLkNbfSNvJCRkLPOGvuMvJlB1fy4u1gs8cCULAeJus42mucNfeDNcR69sOE834MNDLX8l3fqcrMdMtQwXzxdVQTNzSjFt7STj_h2EMsurK_-nvsB9fJkTMiIcDv6uU2b7pbdFxozzY3pomDthoCgNmAxqwiv_Kwwz8EWTnZOm1Kv-_IbsvnQQmohz-L4RjoDoBf9LoZHWItHBV9l8N-pFod8g2GoOyg1JLg2u10NUbAyDFu_yuufCrdJUcYwoe3WhBq5O8dMjlVwgHII-xnyNkxxttSLR78aZjxBFHQjHbnbSdr5fHvAB4Iu9u-yTaq1qmOKMlp7JV6ibsPHiAg2nIFV_rBkRBgTHd-gueQgdXOrnfveVVM_7QHXZy4z-O-z47iZYpTHMxy0]--></g></svg>

<p><code>PointerUpEvent</code>表示一次点击事件周期的结束，因此除了触发控件的点击事件回调外，还做了一些清理工作，比如删除事件路由，执行reset等。还有一项很重要的工作就是处理竞技逻辑，当点击范围存在多个可点击控件时，通过竞技逻辑来决定哪个空间来处理本次点击事件。</p>
<p>下面是竞技场的代码实现：</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">GestureArenaManager</span> </span>&#123;</span><br><span class="line">  <span class="keyword">void</span> sweep(<span class="built_in">int</span> pointer) &#123;</span><br><span class="line">    <span class="keyword">final</span> _GestureArena? state = _arenas[pointer];  <span class="comment">//根据pointer id获取竞技场</span></span><br><span class="line">    ...</span><br><span class="line">    _arenas.remove(pointer);  <span class="comment">//删除竞技场</span></span><br><span class="line">    <span class="keyword">if</span> (state.members.isNotEmpty) &#123;</span><br><span class="line">      <span class="comment">// First member wins.</span></span><br><span class="line">      state.members.first.acceptGesture(pointer);</span><br><span class="line">      <span class="comment">// Give all the other members the bad news.</span></span><br><span class="line">      <span class="keyword">for</span> (<span class="built_in">int</span> i = <span class="number">1</span>; i &lt; state.members.length; i++)</span><br><span class="line">        state.members[i].rejectGesture(pointer);</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>竞技逻辑的代码实现非常简单，如果某次点击存在多个竞争者，则列表的第一个胜出，其他的都失败。所以，竞技的逻辑依赖竞争者的加入顺序，第一个加入的就会赢的胜利。这个顺序就是命中测试的顺序，可以参考hitTest一节的分析。</p>
<h2 id="GestureDetector相关的类图"><a href="#GestureDetector相关的类图" class="headerlink" title="GestureDetector相关的类图"></a>GestureDetector相关的类图</h2><?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="938px" preserveAspectRatio="none" style="width:1209px;height:938px;background:#FFFFFF;" version="1.1" viewBox="0 0 1209 938" width="1209px" zoomAndPan="magnify"><defs/><g><!--class GestureDetector--><g id="elem_GestureDetector"><rect fill="#F1F1F1" height="48" id="GestureDetector" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="155" x="605" y="7"/><ellipse cx="620" cy="23" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M622.3438,18.6719 C621.4063,18.2344 620.8125,18.0938 619.9375,18.0938 C617.3125,18.0938 615.3125,20.1719 615.3125,22.8906 L615.3125,24.0156 C615.3125,26.5938 617.4219,28.4844 620.3125,28.4844 C621.5313,28.4844 622.6875,28.1875 623.4375,27.6406 C624.0156,27.2344 624.3438,26.7813 624.3438,26.3906 C624.3438,25.9375 623.9531,25.5469 623.4844,25.5469 C623.2656,25.5469 623.0625,25.625 622.875,25.8125 C622.4219,26.2969 622.4219,26.2969 622.2344,26.3906 C621.8125,26.6563 621.125,26.7813 620.3594,26.7813 C618.3125,26.7813 617.0156,25.6875 617.0156,23.9844 L617.0156,22.8906 C617.0156,21.1094 618.2656,19.7969 620,19.7969 C620.5781,19.7969 621.1875,19.9531 621.6563,20.2031 C622.1406,20.4844 622.3125,20.7031 622.4063,21.1094 C622.4688,21.5156 622.5,21.6406 622.6406,21.7656 C622.7813,21.9063 623.0156,22.0156 623.2344,22.0156 C623.5,22.0156 623.7656,21.875 623.9375,21.6563 C624.0469,21.5 624.0781,21.3125 624.0781,20.8906 L624.0781,19.4688 C624.0781,19.0313 624.0625,18.9063 623.9688,18.75 C623.8125,18.4844 623.5313,18.3438 623.2344,18.3438 C622.9375,18.3438 622.7344,18.4375 622.5156,18.75 L622.3438,18.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="123" x="634" y="27.8467">GestureDetector</text><line style="stroke:#181818;stroke-width:0.5;" x1="606" x2="759" y1="39" y2="39"/><line style="stroke:#181818;stroke-width:0.5;" x1="606" x2="759" y1="47" y2="47"/></g><!--class RawGestureDetector--><g id="elem_RawGestureDetector"><rect fill="#F1F1F1" height="48" id="RawGestureDetector" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="184" x="590.5" y="124"/><ellipse cx="605.5" cy="140" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M607.8438,135.6719 C606.9063,135.2344 606.3125,135.0938 605.4375,135.0938 C602.8125,135.0938 600.8125,137.1719 600.8125,139.8906 L600.8125,141.0156 C600.8125,143.5938 602.9219,145.4844 605.8125,145.4844 C607.0313,145.4844 608.1875,145.1875 608.9375,144.6406 C609.5156,144.2344 609.8438,143.7813 609.8438,143.3906 C609.8438,142.9375 609.4531,142.5469 608.9844,142.5469 C608.7656,142.5469 608.5625,142.625 608.375,142.8125 C607.9219,143.2969 607.9219,143.2969 607.7344,143.3906 C607.3125,143.6563 606.625,143.7813 605.8594,143.7813 C603.8125,143.7813 602.5156,142.6875 602.5156,140.9844 L602.5156,139.8906 C602.5156,138.1094 603.7656,136.7969 605.5,136.7969 C606.0781,136.7969 606.6875,136.9531 607.1563,137.2031 C607.6406,137.4844 607.8125,137.7031 607.9063,138.1094 C607.9688,138.5156 608,138.6406 608.1406,138.7656 C608.2813,138.9063 608.5156,139.0156 608.7344,139.0156 C609,139.0156 609.2656,138.875 609.4375,138.6563 C609.5469,138.5 609.5781,138.3125 609.5781,137.8906 L609.5781,136.4688 C609.5781,136.0313 609.5625,135.9063 609.4688,135.75 C609.3125,135.4844 609.0313,135.3438 608.7344,135.3438 C608.4375,135.3438 608.2344,135.4375 608.0156,135.75 L607.8438,135.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="152" x="619.5" y="144.8467">RawGestureDetector</text><line style="stroke:#181818;stroke-width:0.5;" x1="591.5" x2="773.5" y1="156" y2="156"/><line style="stroke:#181818;stroke-width:0.5;" x1="591.5" x2="773.5" y1="164" y2="164"/></g><!--class RawGestureDetectorState--><g id="elem_RawGestureDetectorState"><rect codeLine="6" fill="#F1F1F1" height="64.2969" id="RawGestureDetectorState" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="224" x="570.5" y="257"/><ellipse cx="585.5" cy="273" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M587.8438,268.6719 C586.9063,268.2344 586.3125,268.0938 585.4375,268.0938 C582.8125,268.0938 580.8125,270.1719 580.8125,272.8906 L580.8125,274.0156 C580.8125,276.5938 582.9219,278.4844 585.8125,278.4844 C587.0313,278.4844 588.1875,278.1875 588.9375,277.6406 C589.5156,277.2344 589.8438,276.7813 589.8438,276.3906 C589.8438,275.9375 589.4531,275.5469 588.9844,275.5469 C588.7656,275.5469 588.5625,275.625 588.375,275.8125 C587.9219,276.2969 587.9219,276.2969 587.7344,276.3906 C587.3125,276.6563 586.625,276.7813 585.8594,276.7813 C583.8125,276.7813 582.5156,275.6875 582.5156,273.9844 L582.5156,272.8906 C582.5156,271.1094 583.7656,269.7969 585.5,269.7969 C586.0781,269.7969 586.6875,269.9531 587.1563,270.2031 C587.6406,270.4844 587.8125,270.7031 587.9063,271.1094 C587.9688,271.5156 588,271.6406 588.1406,271.7656 C588.2813,271.9063 588.5156,272.0156 588.7344,272.0156 C589,272.0156 589.2656,271.875 589.4375,271.6563 C589.5469,271.5 589.5781,271.3125 589.5781,270.8906 L589.5781,269.4688 C589.5781,269.0313 589.5625,268.9063 589.4688,268.75 C589.3125,268.4844 589.0313,268.3438 588.7344,268.3438 C588.4375,268.3438 588.2344,268.4375 588.0156,268.75 L587.8438,268.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="192" x="599.5" y="277.8467">RawGestureDetectorState</text><line style="stroke:#181818;stroke-width:0.5;" x1="571.5" x2="793.5" y1="289" y2="289"/><line style="stroke:#181818;stroke-width:0.5;" x1="571.5" x2="793.5" y1="297" y2="297"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="200" x="576.5" y="313.9951">_handlePointerDown(event)</text></g><!--class GestureRecognizer--><g id="elem_GestureRecognizer"><rect fill="#F1F1F1" height="48" id="GestureRecognizer" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="170" x="597.5" y="390"/><ellipse cx="612.5" cy="406" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M614.8438,401.6719 C613.9063,401.2344 613.3125,401.0938 612.4375,401.0938 C609.8125,401.0938 607.8125,403.1719 607.8125,405.8906 L607.8125,407.0156 C607.8125,409.5938 609.9219,411.4844 612.8125,411.4844 C614.0313,411.4844 615.1875,411.1875 615.9375,410.6406 C616.5156,410.2344 616.8438,409.7813 616.8438,409.3906 C616.8438,408.9375 616.4531,408.5469 615.9844,408.5469 C615.7656,408.5469 615.5625,408.625 615.375,408.8125 C614.9219,409.2969 614.9219,409.2969 614.7344,409.3906 C614.3125,409.6563 613.625,409.7813 612.8594,409.7813 C610.8125,409.7813 609.5156,408.6875 609.5156,406.9844 L609.5156,405.8906 C609.5156,404.1094 610.7656,402.7969 612.5,402.7969 C613.0781,402.7969 613.6875,402.9531 614.1563,403.2031 C614.6406,403.4844 614.8125,403.7031 614.9063,404.1094 C614.9688,404.5156 615,404.6406 615.1406,404.7656 C615.2813,404.9063 615.5156,405.0156 615.7344,405.0156 C616,405.0156 616.2656,404.875 616.4375,404.6563 C616.5469,404.5 616.5781,404.3125 616.5781,403.8906 L616.5781,402.4688 C616.5781,402.0313 616.5625,401.9063 616.4688,401.75 C616.3125,401.4844 616.0313,401.3438 615.7344,401.3438 C615.4375,401.3438 615.2344,401.4375 615.0156,401.75 L614.8438,401.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="138" x="626.5" y="410.8467">GestureRecognizer</text><line style="stroke:#181818;stroke-width:0.5;" x1="598.5" x2="766.5" y1="422" y2="422"/><line style="stroke:#181818;stroke-width:0.5;" x1="598.5" x2="766.5" y1="430" y2="430"/></g><!--class OneSequenceGestureRecognizer--><g id="elem_OneSequenceGestureRecognizer"><rect fill="#F1F1F1" height="48" id="OneSequenceGestureRecognizer" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="269" x="548" y="515"/><ellipse cx="563" cy="531" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M565.3438,526.6719 C564.4063,526.2344 563.8125,526.0938 562.9375,526.0938 C560.3125,526.0938 558.3125,528.1719 558.3125,530.8906 L558.3125,532.0156 C558.3125,534.5938 560.4219,536.4844 563.3125,536.4844 C564.5313,536.4844 565.6875,536.1875 566.4375,535.6406 C567.0156,535.2344 567.3438,534.7813 567.3438,534.3906 C567.3438,533.9375 566.9531,533.5469 566.4844,533.5469 C566.2656,533.5469 566.0625,533.625 565.875,533.8125 C565.4219,534.2969 565.4219,534.2969 565.2344,534.3906 C564.8125,534.6563 564.125,534.7813 563.3594,534.7813 C561.3125,534.7813 560.0156,533.6875 560.0156,531.9844 L560.0156,530.8906 C560.0156,529.1094 561.2656,527.7969 563,527.7969 C563.5781,527.7969 564.1875,527.9531 564.6563,528.2031 C565.1406,528.4844 565.3125,528.7031 565.4063,529.1094 C565.4688,529.5156 565.5,529.6406 565.6406,529.7656 C565.7813,529.9063 566.0156,530.0156 566.2344,530.0156 C566.5,530.0156 566.7656,529.875 566.9375,529.6563 C567.0469,529.5 567.0781,529.3125 567.0781,528.8906 L567.0781,527.4688 C567.0781,527.0313 567.0625,526.9063 566.9688,526.75 C566.8125,526.4844 566.5313,526.3438 566.2344,526.3438 C565.9375,526.3438 565.7344,526.4375 565.5156,526.75 L565.3438,526.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="237" x="577" y="535.8467">OneSequenceGestureRecognizer</text><line style="stroke:#181818;stroke-width:0.5;" x1="549" x2="816" y1="547" y2="547"/><line style="stroke:#181818;stroke-width:0.5;" x1="549" x2="816" y1="555" y2="555"/></g><!--class PrimaryPointerGestureRecognizer--><g id="elem_PrimaryPointerGestureRecognizer"><rect fill="#F1F1F1" height="48" id="PrimaryPointerGestureRecognizer" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="278" x="528.5" y="632"/><ellipse cx="543.5" cy="648" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M545.8438,643.6719 C544.9063,643.2344 544.3125,643.0938 543.4375,643.0938 C540.8125,643.0938 538.8125,645.1719 538.8125,647.8906 L538.8125,649.0156 C538.8125,651.5938 540.9219,653.4844 543.8125,653.4844 C545.0313,653.4844 546.1875,653.1875 546.9375,652.6406 C547.5156,652.2344 547.8438,651.7813 547.8438,651.3906 C547.8438,650.9375 547.4531,650.5469 546.9844,650.5469 C546.7656,650.5469 546.5625,650.625 546.375,650.8125 C545.9219,651.2969 545.9219,651.2969 545.7344,651.3906 C545.3125,651.6563 544.625,651.7813 543.8594,651.7813 C541.8125,651.7813 540.5156,650.6875 540.5156,648.9844 L540.5156,647.8906 C540.5156,646.1094 541.7656,644.7969 543.5,644.7969 C544.0781,644.7969 544.6875,644.9531 545.1563,645.2031 C545.6406,645.4844 545.8125,645.7031 545.9063,646.1094 C545.9688,646.5156 546,646.6406 546.1406,646.7656 C546.2813,646.9063 546.5156,647.0156 546.7344,647.0156 C547,647.0156 547.2656,646.875 547.4375,646.6563 C547.5469,646.5 547.5781,646.3125 547.5781,645.8906 L547.5781,644.4688 C547.5781,644.0313 547.5625,643.9063 547.4688,643.75 C547.3125,643.4844 547.0313,643.3438 546.7344,643.3438 C546.4375,643.3438 546.2344,643.4375 546.0156,643.75 L545.8438,643.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="246" x="557.5" y="652.8467">PrimaryPointerGestureRecognizer</text><line style="stroke:#181818;stroke-width:0.5;" x1="529.5" x2="805.5" y1="664" y2="664"/><line style="stroke:#181818;stroke-width:0.5;" x1="529.5" x2="805.5" y1="672" y2="672"/></g><!--class BaseTapGestureRecognizer--><g id="elem_BaseTapGestureRecognizer"><rect codeLine="9" fill="#F1F1F1" height="80.5938" id="BaseTapGestureRecognizer" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="231" x="348" y="741"/><ellipse cx="363" cy="757" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M365.3438,752.6719 C364.4063,752.2344 363.8125,752.0938 362.9375,752.0938 C360.3125,752.0938 358.3125,754.1719 358.3125,756.8906 L358.3125,758.0156 C358.3125,760.5938 360.4219,762.4844 363.3125,762.4844 C364.5313,762.4844 365.6875,762.1875 366.4375,761.6406 C367.0156,761.2344 367.3438,760.7813 367.3438,760.3906 C367.3438,759.9375 366.9531,759.5469 366.4844,759.5469 C366.2656,759.5469 366.0625,759.625 365.875,759.8125 C365.4219,760.2969 365.4219,760.2969 365.2344,760.3906 C364.8125,760.6563 364.125,760.7813 363.3594,760.7813 C361.3125,760.7813 360.0156,759.6875 360.0156,757.9844 L360.0156,756.8906 C360.0156,755.1094 361.2656,753.7969 363,753.7969 C363.5781,753.7969 364.1875,753.9531 364.6563,754.2031 C365.1406,754.4844 365.3125,754.7031 365.4063,755.1094 C365.4688,755.5156 365.5,755.6406 365.6406,755.7656 C365.7813,755.9063 366.0156,756.0156 366.2344,756.0156 C366.5,756.0156 366.7656,755.875 366.9375,755.6563 C367.0469,755.5 367.0781,755.3125 367.0781,754.8906 L367.0781,753.4688 C367.0781,753.0313 367.0625,752.9063 366.9688,752.75 C366.8125,752.4844 366.5313,752.3438 366.2344,752.3438 C365.9375,752.3438 365.7344,752.4375 365.5156,752.75 L365.3438,752.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="199" x="377" y="761.8467">BaseTapGestureRecognizer</text><line style="stroke:#181818;stroke-width:0.5;" x1="349" x2="578" y1="773" y2="773"/><line style="stroke:#181818;stroke-width:0.5;" x1="349" x2="578" y1="781" y2="781"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="195" x="354" y="797.9951">acceptGesture(int pointer)</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="188" x="354" y="814.292">rejectGesture(int pointer)</text></g><!--class TapGestureRecognizer--><g id="elem_TapGestureRecognizer"><rect fill="#F1F1F1" height="48" id="TapGestureRecognizer" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="197" x="365" y="883"/><ellipse cx="380" cy="899" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M382.3438,894.6719 C381.4063,894.2344 380.8125,894.0938 379.9375,894.0938 C377.3125,894.0938 375.3125,896.1719 375.3125,898.8906 L375.3125,900.0156 C375.3125,902.5938 377.4219,904.4844 380.3125,904.4844 C381.5313,904.4844 382.6875,904.1875 383.4375,903.6406 C384.0156,903.2344 384.3438,902.7813 384.3438,902.3906 C384.3438,901.9375 383.9531,901.5469 383.4844,901.5469 C383.2656,901.5469 383.0625,901.625 382.875,901.8125 C382.4219,902.2969 382.4219,902.2969 382.2344,902.3906 C381.8125,902.6563 381.125,902.7813 380.3594,902.7813 C378.3125,902.7813 377.0156,901.6875 377.0156,899.9844 L377.0156,898.8906 C377.0156,897.1094 378.2656,895.7969 380,895.7969 C380.5781,895.7969 381.1875,895.9531 381.6563,896.2031 C382.1406,896.4844 382.3125,896.7031 382.4063,897.1094 C382.4688,897.5156 382.5,897.6406 382.6406,897.7656 C382.7813,897.9063 383.0156,898.0156 383.2344,898.0156 C383.5,898.0156 383.7656,897.875 383.9375,897.6563 C384.0469,897.5 384.0781,897.3125 384.0781,896.8906 L384.0781,895.4688 C384.0781,895.0313 384.0625,894.9063 383.9688,894.75 C383.8125,894.4844 383.5313,894.3438 383.2344,894.3438 C382.9375,894.3438 382.7344,894.4375 382.5156,894.75 L382.3438,894.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="165" x="394" y="903.8467">TapGestureRecognizer</text><line style="stroke:#181818;stroke-width:0.5;" x1="366" x2="561" y1="915" y2="915"/><line style="stroke:#181818;stroke-width:0.5;" x1="366" x2="561" y1="923" y2="923"/></g><!--class LongPressGestureRecognizer--><g id="elem_LongPressGestureRecognizer"><rect fill="#F1F1F1" height="48" id="LongPressGestureRecognizer" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="243" x="614" y="757.5"/><ellipse cx="629" cy="773.5" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M631.3438,769.1719 C630.4063,768.7344 629.8125,768.5938 628.9375,768.5938 C626.3125,768.5938 624.3125,770.6719 624.3125,773.3906 L624.3125,774.5156 C624.3125,777.0938 626.4219,778.9844 629.3125,778.9844 C630.5313,778.9844 631.6875,778.6875 632.4375,778.1406 C633.0156,777.7344 633.3438,777.2813 633.3438,776.8906 C633.3438,776.4375 632.9531,776.0469 632.4844,776.0469 C632.2656,776.0469 632.0625,776.125 631.875,776.3125 C631.4219,776.7969 631.4219,776.7969 631.2344,776.8906 C630.8125,777.1563 630.125,777.2813 629.3594,777.2813 C627.3125,777.2813 626.0156,776.1875 626.0156,774.4844 L626.0156,773.3906 C626.0156,771.6094 627.2656,770.2969 629,770.2969 C629.5781,770.2969 630.1875,770.4531 630.6563,770.7031 C631.1406,770.9844 631.3125,771.2031 631.4063,771.6094 C631.4688,772.0156 631.5,772.1406 631.6406,772.2656 C631.7813,772.4063 632.0156,772.5156 632.2344,772.5156 C632.5,772.5156 632.7656,772.375 632.9375,772.1563 C633.0469,772 633.0781,771.8125 633.0781,771.3906 L633.0781,769.9688 C633.0781,769.5313 633.0625,769.4063 632.9688,769.25 C632.8125,768.9844 632.5313,768.8438 632.2344,768.8438 C631.9375,768.8438 631.7344,768.9375 631.5156,769.25 L631.3438,769.1719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="211" x="643" y="778.3467">LongPressGestureRecognizer</text><line style="stroke:#181818;stroke-width:0.5;" x1="615" x2="856" y1="789.5" y2="789.5"/><line style="stroke:#181818;stroke-width:0.5;" x1="615" x2="856" y1="797.5" y2="797.5"/></g><!--class Listener--><g id="elem_Listener"><rect codeLine="18" fill="#F1F1F1" height="64.2969" id="Listener" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="123" x="343" y="382"/><ellipse cx="372.4" cy="398" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M374.7438,393.6719 C373.8063,393.2344 373.2125,393.0938 372.3375,393.0938 C369.7125,393.0938 367.7125,395.1719 367.7125,397.8906 L367.7125,399.0156 C367.7125,401.5938 369.8219,403.4844 372.7125,403.4844 C373.9313,403.4844 375.0875,403.1875 375.8375,402.6406 C376.4156,402.2344 376.7438,401.7813 376.7438,401.3906 C376.7438,400.9375 376.3531,400.5469 375.8844,400.5469 C375.6656,400.5469 375.4625,400.625 375.275,400.8125 C374.8219,401.2969 374.8219,401.2969 374.6344,401.3906 C374.2125,401.6563 373.525,401.7813 372.7594,401.7813 C370.7125,401.7813 369.4156,400.6875 369.4156,398.9844 L369.4156,397.8906 C369.4156,396.1094 370.6656,394.7969 372.4,394.7969 C372.9781,394.7969 373.5875,394.9531 374.0563,395.2031 C374.5406,395.4844 374.7125,395.7031 374.8063,396.1094 C374.8688,396.5156 374.9,396.6406 375.0406,396.7656 C375.1813,396.9063 375.4156,397.0156 375.6344,397.0156 C375.9,397.0156 376.1656,396.875 376.3375,396.6563 C376.4469,396.5 376.4781,396.3125 376.4781,395.8906 L376.4781,394.4688 C376.4781,394.0313 376.4625,393.9063 376.3688,393.75 C376.2125,393.4844 375.9313,393.3438 375.6344,393.3438 C375.3375,393.3438 375.1344,393.4375 374.9156,393.75 L374.7438,393.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="59" x="389.6" y="402.8467">Listener</text><line style="stroke:#181818;stroke-width:0.5;" x1="344" x2="465" y1="414" y2="414"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="349" y="430.9951">onPointerDown</text><line style="stroke:#181818;stroke-width:0.5;" x1="344" x2="465" y1="438.2969" y2="438.2969"/></g><!--class SingleChildRenderObjectWidget--><g id="elem_SingleChildRenderObjectWidget"><rect fill="#F1F1F1" height="48" id="SingleChildRenderObjectWidget" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="265" x="270" y="265"/><ellipse cx="285" cy="281" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M287.3438,276.6719 C286.4063,276.2344 285.8125,276.0938 284.9375,276.0938 C282.3125,276.0938 280.3125,278.1719 280.3125,280.8906 L280.3125,282.0156 C280.3125,284.5938 282.4219,286.4844 285.3125,286.4844 C286.5313,286.4844 287.6875,286.1875 288.4375,285.6406 C289.0156,285.2344 289.3438,284.7813 289.3438,284.3906 C289.3438,283.9375 288.9531,283.5469 288.4844,283.5469 C288.2656,283.5469 288.0625,283.625 287.875,283.8125 C287.4219,284.2969 287.4219,284.2969 287.2344,284.3906 C286.8125,284.6563 286.125,284.7813 285.3594,284.7813 C283.3125,284.7813 282.0156,283.6875 282.0156,281.9844 L282.0156,280.8906 C282.0156,279.1094 283.2656,277.7969 285,277.7969 C285.5781,277.7969 286.1875,277.9531 286.6563,278.2031 C287.1406,278.4844 287.3125,278.7031 287.4063,279.1094 C287.4688,279.5156 287.5,279.6406 287.6406,279.7656 C287.7813,279.9063 288.0156,280.0156 288.2344,280.0156 C288.5,280.0156 288.7656,279.875 288.9375,279.6563 C289.0469,279.5 289.0781,279.3125 289.0781,278.8906 L289.0781,277.4688 C289.0781,277.0313 289.0625,276.9063 288.9688,276.75 C288.8125,276.4844 288.5313,276.3438 288.2344,276.3438 C287.9375,276.3438 287.7344,276.4375 287.5156,276.75 L287.3438,276.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="233" x="299" y="285.8467">SingleChildRenderObjectWidget</text><line style="stroke:#181818;stroke-width:0.5;" x1="271" x2="534" y1="297" y2="297"/><line style="stroke:#181818;stroke-width:0.5;" x1="271" x2="534" y1="305" y2="305"/></g><!--class RenderPointerListener--><g id="elem_RenderPointerListener"><rect codeLine="23" fill="#F1F1F1" height="64.2969" id="RenderPointerListener" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="201" x="165" y="507"/><ellipse cx="182.25" cy="523" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M184.5938,518.6719 C183.6563,518.2344 183.0625,518.0938 182.1875,518.0938 C179.5625,518.0938 177.5625,520.1719 177.5625,522.8906 L177.5625,524.0156 C177.5625,526.5938 179.6719,528.4844 182.5625,528.4844 C183.7813,528.4844 184.9375,528.1875 185.6875,527.6406 C186.2656,527.2344 186.5938,526.7813 186.5938,526.3906 C186.5938,525.9375 186.2031,525.5469 185.7344,525.5469 C185.5156,525.5469 185.3125,525.625 185.125,525.8125 C184.6719,526.2969 184.6719,526.2969 184.4844,526.3906 C184.0625,526.6563 183.375,526.7813 182.6094,526.7813 C180.5625,526.7813 179.2656,525.6875 179.2656,523.9844 L179.2656,522.8906 C179.2656,521.1094 180.5156,519.7969 182.25,519.7969 C182.8281,519.7969 183.4375,519.9531 183.9063,520.2031 C184.3906,520.4844 184.5625,520.7031 184.6563,521.1094 C184.7188,521.5156 184.75,521.6406 184.8906,521.7656 C185.0313,521.9063 185.2656,522.0156 185.4844,522.0156 C185.75,522.0156 186.0156,521.875 186.1875,521.6563 C186.2969,521.5 186.3281,521.3125 186.3281,520.8906 L186.3281,519.4688 C186.3281,519.0313 186.3125,518.9063 186.2188,518.75 C186.0625,518.4844 185.7813,518.3438 185.4844,518.3438 C185.1875,518.3438 184.9844,518.4375 184.7656,518.75 L184.5938,518.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="164" x="196.75" y="527.8467">RenderPointerListener</text><line style="stroke:#181818;stroke-width:0.5;" x1="166" x2="365" y1="539" y2="539"/><line style="stroke:#181818;stroke-width:0.5;" x1="166" x2="365" y1="547" y2="547"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="189" x="171" y="563.9951">handleEvent(event, entry)</text></g><!--class RenderProxyBoxWithHitTestBehavior--><g id="elem_RenderProxyBoxWithHitTestBehavior"><rect codeLine="27" fill="#F1F1F1" height="64.2969" id="RenderProxyBoxWithHitTestBehavior" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="301" x="7" y="382"/><ellipse cx="22" cy="398" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M24.3438,393.6719 C23.4063,393.2344 22.8125,393.0938 21.9375,393.0938 C19.3125,393.0938 17.3125,395.1719 17.3125,397.8906 L17.3125,399.0156 C17.3125,401.5938 19.4219,403.4844 22.3125,403.4844 C23.5313,403.4844 24.6875,403.1875 25.4375,402.6406 C26.0156,402.2344 26.3438,401.7813 26.3438,401.3906 C26.3438,400.9375 25.9531,400.5469 25.4844,400.5469 C25.2656,400.5469 25.0625,400.625 24.875,400.8125 C24.4219,401.2969 24.4219,401.2969 24.2344,401.3906 C23.8125,401.6563 23.125,401.7813 22.3594,401.7813 C20.3125,401.7813 19.0156,400.6875 19.0156,398.9844 L19.0156,397.8906 C19.0156,396.1094 20.2656,394.7969 22,394.7969 C22.5781,394.7969 23.1875,394.9531 23.6563,395.2031 C24.1406,395.4844 24.3125,395.7031 24.4063,396.1094 C24.4688,396.5156 24.5,396.6406 24.6406,396.7656 C24.7813,396.9063 25.0156,397.0156 25.2344,397.0156 C25.5,397.0156 25.7656,396.875 25.9375,396.6563 C26.0469,396.5 26.0781,396.3125 26.0781,395.8906 L26.0781,394.4688 C26.0781,394.0313 26.0625,393.9063 25.9688,393.75 C25.8125,393.4844 25.5313,393.3438 25.2344,393.3438 C24.9375,393.3438 24.7344,393.4375 24.5156,393.75 L24.3438,393.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="269" x="36" y="402.8467">RenderProxyBoxWithHitTestBehavior</text><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="307" y1="414" y2="414"/><line style="stroke:#181818;stroke-width:0.5;" x1="8" x2="307" y1="422" y2="422"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="113" x="13" y="438.9951">bool hitTest(...)</text></g><!--class RenderProxyBoxMixin--><g id="elem_RenderProxyBoxMixin"><rect codeLine="31" fill="#F1F1F1" height="64.2969" id="RenderProxyBoxMixin" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="188" x="63.5" y="116"/><ellipse cx="78.5" cy="132" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M80.8438,127.6719 C79.9063,127.2344 79.3125,127.0938 78.4375,127.0938 C75.8125,127.0938 73.8125,129.1719 73.8125,131.8906 L73.8125,133.0156 C73.8125,135.5938 75.9219,137.4844 78.8125,137.4844 C80.0313,137.4844 81.1875,137.1875 81.9375,136.6406 C82.5156,136.2344 82.8438,135.7813 82.8438,135.3906 C82.8438,134.9375 82.4531,134.5469 81.9844,134.5469 C81.7656,134.5469 81.5625,134.625 81.375,134.8125 C80.9219,135.2969 80.9219,135.2969 80.7344,135.3906 C80.3125,135.6563 79.625,135.7813 78.8594,135.7813 C76.8125,135.7813 75.5156,134.6875 75.5156,132.9844 L75.5156,131.8906 C75.5156,130.1094 76.7656,128.7969 78.5,128.7969 C79.0781,128.7969 79.6875,128.9531 80.1563,129.2031 C80.6406,129.4844 80.8125,129.7031 80.9063,130.1094 C80.9688,130.5156 81,130.6406 81.1406,130.7656 C81.2813,130.9063 81.5156,131.0156 81.7344,131.0156 C82,131.0156 82.2656,130.875 82.4375,130.6563 C82.5469,130.5 82.5781,130.3125 82.5781,129.8906 L82.5781,128.4688 C82.5781,128.0313 82.5625,127.9063 82.4688,127.75 C82.3125,127.4844 82.0313,127.3438 81.7344,127.3438 C81.4375,127.3438 81.2344,127.4375 81.0156,127.75 L80.8438,127.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="156" x="92.5" y="136.8467">RenderProxyBoxMixin</text><line style="stroke:#181818;stroke-width:0.5;" x1="64.5" x2="250.5" y1="148" y2="148"/><line style="stroke:#181818;stroke-width:0.5;" x1="64.5" x2="250.5" y1="156" y2="156"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="173" x="69.5" y="172.9951">bool hitTestChildren(...)</text></g><!--class RenderProxyBox--><g id="elem_RenderProxyBox"><rect fill="#F1F1F1" height="48" id="RenderProxyBox" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="151" x="82" y="265"/><ellipse cx="97" cy="281" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M99.3438,276.6719 C98.4063,276.2344 97.8125,276.0938 96.9375,276.0938 C94.3125,276.0938 92.3125,278.1719 92.3125,280.8906 L92.3125,282.0156 C92.3125,284.5938 94.4219,286.4844 97.3125,286.4844 C98.5313,286.4844 99.6875,286.1875 100.4375,285.6406 C101.0156,285.2344 101.3438,284.7813 101.3438,284.3906 C101.3438,283.9375 100.9531,283.5469 100.4844,283.5469 C100.2656,283.5469 100.0625,283.625 99.875,283.8125 C99.4219,284.2969 99.4219,284.2969 99.2344,284.3906 C98.8125,284.6563 98.125,284.7813 97.3594,284.7813 C95.3125,284.7813 94.0156,283.6875 94.0156,281.9844 L94.0156,280.8906 C94.0156,279.1094 95.2656,277.7969 97,277.7969 C97.5781,277.7969 98.1875,277.9531 98.6563,278.2031 C99.1406,278.4844 99.3125,278.7031 99.4063,279.1094 C99.4688,279.5156 99.5,279.6406 99.6406,279.7656 C99.7813,279.9063 100.0156,280.0156 100.2344,280.0156 C100.5,280.0156 100.7656,279.875 100.9375,279.6563 C101.0469,279.5 101.0781,279.3125 101.0781,278.8906 L101.0781,277.4688 C101.0781,277.0313 101.0625,276.9063 100.9688,276.75 C100.8125,276.4844 100.5313,276.3438 100.2344,276.3438 C99.9375,276.3438 99.7344,276.4375 99.5156,276.75 L99.3438,276.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="119" x="111" y="285.8467">RenderProxyBox</text><line style="stroke:#181818;stroke-width:0.5;" x1="83" x2="232" y1="297" y2="297"/><line style="stroke:#181818;stroke-width:0.5;" x1="83" x2="232" y1="305" y2="305"/></g><!--class GestureBinding--><g id="elem_GestureBinding"><rect fill="#F1F1F1" height="48" id="GestureBinding" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="143" x="866" y="515"/><ellipse cx="881" cy="531" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M883.3438,526.6719 C882.4063,526.2344 881.8125,526.0938 880.9375,526.0938 C878.3125,526.0938 876.3125,528.1719 876.3125,530.8906 L876.3125,532.0156 C876.3125,534.5938 878.4219,536.4844 881.3125,536.4844 C882.5313,536.4844 883.6875,536.1875 884.4375,535.6406 C885.0156,535.2344 885.3438,534.7813 885.3438,534.3906 C885.3438,533.9375 884.9531,533.5469 884.4844,533.5469 C884.2656,533.5469 884.0625,533.625 883.875,533.8125 C883.4219,534.2969 883.4219,534.2969 883.2344,534.3906 C882.8125,534.6563 882.125,534.7813 881.3594,534.7813 C879.3125,534.7813 878.0156,533.6875 878.0156,531.9844 L878.0156,530.8906 C878.0156,529.1094 879.2656,527.7969 881,527.7969 C881.5781,527.7969 882.1875,527.9531 882.6563,528.2031 C883.1406,528.4844 883.3125,528.7031 883.4063,529.1094 C883.4688,529.5156 883.5,529.6406 883.6406,529.7656 C883.7813,529.9063 884.0156,530.0156 884.2344,530.0156 C884.5,530.0156 884.7656,529.875 884.9375,529.6563 C885.0469,529.5 885.0781,529.3125 885.0781,528.8906 L885.0781,527.4688 C885.0781,527.0313 885.0625,526.9063 884.9688,526.75 C884.8125,526.4844 884.5313,526.3438 884.2344,526.3438 C883.9375,526.3438 883.7344,526.4375 883.5156,526.75 L883.3438,526.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="111" x="895" y="535.8467">GestureBinding</text><line style="stroke:#181818;stroke-width:0.5;" x1="867" x2="1008" y1="547" y2="547"/><line style="stroke:#181818;stroke-width:0.5;" x1="867" x2="1008" y1="555" y2="555"/></g><!--class GestureArenaManager--><g id="elem_GestureArenaManager"><rect fill="#F1F1F1" height="48" id="GestureArenaManager" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="192" x="841.5" y="632"/><ellipse cx="856.5" cy="648" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M858.8438,643.6719 C857.9063,643.2344 857.3125,643.0938 856.4375,643.0938 C853.8125,643.0938 851.8125,645.1719 851.8125,647.8906 L851.8125,649.0156 C851.8125,651.5938 853.9219,653.4844 856.8125,653.4844 C858.0313,653.4844 859.1875,653.1875 859.9375,652.6406 C860.5156,652.2344 860.8438,651.7813 860.8438,651.3906 C860.8438,650.9375 860.4531,650.5469 859.9844,650.5469 C859.7656,650.5469 859.5625,650.625 859.375,650.8125 C858.9219,651.2969 858.9219,651.2969 858.7344,651.3906 C858.3125,651.6563 857.625,651.7813 856.8594,651.7813 C854.8125,651.7813 853.5156,650.6875 853.5156,648.9844 L853.5156,647.8906 C853.5156,646.1094 854.7656,644.7969 856.5,644.7969 C857.0781,644.7969 857.6875,644.9531 858.1563,645.2031 C858.6406,645.4844 858.8125,645.7031 858.9063,646.1094 C858.9688,646.5156 859,646.6406 859.1406,646.7656 C859.2813,646.9063 859.5156,647.0156 859.7344,647.0156 C860,647.0156 860.2656,646.875 860.4375,646.6563 C860.5469,646.5 860.5781,646.3125 860.5781,645.8906 L860.5781,644.4688 C860.5781,644.0313 860.5625,643.9063 860.4688,643.75 C860.3125,643.4844 860.0313,643.3438 859.7344,643.3438 C859.4375,643.3438 859.2344,643.4375 859.0156,643.75 L858.8438,643.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="160" x="870.5" y="652.8467">GestureArenaManager</text><line style="stroke:#181818;stroke-width:0.5;" x1="842.5" x2="1032.5" y1="664" y2="664"/><line style="stroke:#181818;stroke-width:0.5;" x1="842.5" x2="1032.5" y1="672" y2="672"/></g><!--class PointerRouter--><g id="elem_PointerRouter"><rect fill="#F1F1F1" height="48" id="PointerRouter" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="134" x="1068.5" y="632"/><ellipse cx="1083.5" cy="648" fill="#ADD1B2" rx="11" ry="11" style="stroke:#181818;stroke-width:1.0;"/><path d="M1085.8438,643.6719 C1084.9063,643.2344 1084.3125,643.0938 1083.4375,643.0938 C1080.8125,643.0938 1078.8125,645.1719 1078.8125,647.8906 L1078.8125,649.0156 C1078.8125,651.5938 1080.9219,653.4844 1083.8125,653.4844 C1085.0313,653.4844 1086.1875,653.1875 1086.9375,652.6406 C1087.5156,652.2344 1087.8438,651.7813 1087.8438,651.3906 C1087.8438,650.9375 1087.4531,650.5469 1086.9844,650.5469 C1086.7656,650.5469 1086.5625,650.625 1086.375,650.8125 C1085.9219,651.2969 1085.9219,651.2969 1085.7344,651.3906 C1085.3125,651.6563 1084.625,651.7813 1083.8594,651.7813 C1081.8125,651.7813 1080.5156,650.6875 1080.5156,648.9844 L1080.5156,647.8906 C1080.5156,646.1094 1081.7656,644.7969 1083.5,644.7969 C1084.0781,644.7969 1084.6875,644.9531 1085.1563,645.2031 C1085.6406,645.4844 1085.8125,645.7031 1085.9063,646.1094 C1085.9688,646.5156 1086,646.6406 1086.1406,646.7656 C1086.2813,646.9063 1086.5156,647.0156 1086.7344,647.0156 C1087,647.0156 1087.2656,646.875 1087.4375,646.6563 C1087.5469,646.5 1087.5781,646.3125 1087.5781,645.8906 L1087.5781,644.4688 C1087.5781,644.0313 1087.5625,643.9063 1087.4688,643.75 C1087.3125,643.4844 1087.0313,643.3438 1086.7344,643.3438 C1086.4375,643.3438 1086.2344,643.4375 1086.0156,643.75 L1085.8438,643.6719 Z " fill="#000000"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="102" x="1097.5" y="652.8467">PointerRouter</text><line style="stroke:#181818;stroke-width:0.5;" x1="1069.5" x2="1201.5" y1="664" y2="664"/><line style="stroke:#181818;stroke-width:0.5;" x1="1069.5" x2="1201.5" y1="672" y2="672"/></g><!--reverse link GestureDetector to RawGestureDetector--><g id="link_GestureDetector_RawGestureDetector"><path codeLine="1" d="M682.5,67.272 C682.5,87.224 682.5,103.821 682.5,123.763 " fill="none" id="GestureDetector-backto-RawGestureDetector" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="682.5,55.272,678.5,61.272,682.5,67.272,686.5,61.272,682.5,55.272" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RawGestureDetector to RawGestureDetectorState--><g id="link_RawGestureDetector_RawGestureDetectorState"><path codeLine="2" d="M682.5,184.265 C682.5,207.451 682.5,231.2 682.5,256.83 " fill="none" id="RawGestureDetector-backto-RawGestureDetectorState" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="682.5,172.265,678.5,178.265,682.5,184.265,686.5,178.265,682.5,172.265" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RawGestureDetectorState to GestureRecognizer--><g id="link_RawGestureDetectorState_GestureRecognizer"><path codeLine="3" d="M682.5,333.038 C682.5,354.388 682.5,370.291 682.5,389.738 " fill="none" id="RawGestureDetectorState-backto-GestureRecognizer" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="682.5,321.038,678.5,327.038,682.5,333.038,686.5,327.038,682.5,321.038" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="673.675" y="341.2427">1</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="8" x="673.525" y="379.0791">n</text></g><!--reverse link GestureRecognizer to OneSequenceGestureRecognizer--><g id="link_GestureRecognizer_OneSequenceGestureRecognizer"><path codeLine="4" d="M682.5,456.135 C682.5,478.126 682.5,493.012 682.5,514.968 " fill="none" id="GestureRecognizer-backto-OneSequenceGestureRecognizer" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="682.5,438.135,676.5,456.135,688.5,456.135,682.5,438.135" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link OneSequenceGestureRecognizer to PrimaryPointerGestureRecognizer--><g id="link_OneSequenceGestureRecognizer_PrimaryPointerGestureRecognizer"><path codeLine="5" d="M677.1364,581.1207 C674.5334,601.0727 673.132,611.821 670.531,631.763 " fill="none" id="OneSequenceGestureRecognizer-backto-PrimaryPointerGestureRecognizer" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="679.465,563.272,671.1868,580.3445,683.086,581.8969,679.465,563.272" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link PrimaryPointerGestureRecognizer to BaseTapGestureRecognizer--><g id="link_PrimaryPointerGestureRecognizer_BaseTapGestureRecognizer"><path codeLine="13" d="M613.7309,689.5509 C585.5689,706.5999 562.031,720.85 528.985,740.856 " fill="none" id="PrimaryPointerGestureRecognizer-backto-BaseTapGestureRecognizer" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="629.129,680.229,610.6236,684.4182,616.8382,694.6836,629.129,680.229" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link BaseTapGestureRecognizer to TapGestureRecognizer--><g id="link_BaseTapGestureRecognizer_TapGestureRecognizer"><path codeLine="14" d="M463.5,840.256 C463.5,860.2818 463.5,865.8577 463.5,882.8838 " fill="none" id="BaseTapGestureRecognizer-backto-TapGestureRecognizer" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="463.5,822.256,457.5,840.256,469.5,840.256,463.5,822.256" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link PrimaryPointerGestureRecognizer to LongPressGestureRecognizer--><g id="link_PrimaryPointerGestureRecognizer_LongPressGestureRecognizer"><path codeLine="15" d="M688.9722,695.9967 C701.1302,718.0767 710.629,735.329 722.767,757.375 " fill="none" id="PrimaryPointerGestureRecognizer-backto-LongPressGestureRecognizer" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="680.29,680.229,683.7163,698.8907,694.2281,693.1026,680.29,680.229" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RawGestureDetectorState to Listener--><g id="link_RawGestureDetectorState_Listener"><path codeLine="17" d="M601.3751,325.8934 C556.3371,345.8204 509.371,366.6 466.111,385.74 " fill="none" id="RawGestureDetectorState-backto-Listener" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="612.349,321.038,605.2436,319.8077,601.3751,325.8934,608.4805,327.1236,612.349,321.038" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link SingleChildRenderObjectWidget to Listener--><g id="link_SingleChildRenderObjectWidget_Listener"><path codeLine="22" d="M403.169,331.1326 C403.484,350.4786 403.642,360.26 403.99,381.611 " fill="none" id="SingleChildRenderObjectWidget-backto-Listener" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="402.876,313.135,397.1698,331.2303,409.1682,331.0349,402.876,313.135" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link Listener to RenderPointerListener--><g id="link_Listener_RenderPointerListener"><path codeLine="26" d="M360.4374,453.9904 C339.3664,472.6364 321.634,488.328 300.564,506.972 " fill="none" id="Listener-backto-RenderPointerListener" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="369.424,446.038,362.2799,447.0186,360.4374,453.9904,367.5815,453.0097,369.424,446.038" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RenderProxyBoxMixin to RenderProxyBox--><g id="link_RenderProxyBoxMixin_RenderProxyBox"><path codeLine="30" d="M157.5,198.194 C157.5,223.808 157.5,241.516 157.5,264.695 " fill="none" id="RenderProxyBoxMixin-backto-RenderProxyBox" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="157.5,180.194,151.5,198.194,163.5,198.194,157.5,180.194" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="27" x="158.5" y="223.0669">with</text></g><!--reverse link RenderProxyBox to RenderProxyBoxWithHitTestBehavior--><g id="link_RenderProxyBox_RenderProxyBoxWithHitTestBehavior"><path codeLine="34" d="M157.5,331.135 C157.5,350.481 157.5,360.26 157.5,381.611 " fill="none" id="RenderProxyBox-backto-RenderProxyBoxWithHitTestBehavior" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="157.5,313.135,151.5,331.135,163.5,331.135,157.5,313.135" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link RenderProxyBoxWithHitTestBehavior to RenderPointerListener--><g id="link_RenderProxyBoxWithHitTestBehavior_RenderPointerListener"><path codeLine="35" d="M196.6294,459.564 C213.0014,478.21 221.885,488.328 238.256,506.972 " fill="none" id="RenderProxyBoxWithHitTestBehavior-backto-RenderPointerListener" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="none" points="184.753,446.038,192.1207,463.5228,201.138,455.6052,184.753,446.038" style="stroke:#181818;stroke-width:1.0;"/></g><!--link OneSequenceGestureRecognizer to GestureBinding--><g id="link_OneSequenceGestureRecognizer_GestureBinding"><path codeLine="36" d="M817.471,539 C833.568,539 843.666,539 859.764,539 " fill="none" id="OneSequenceGestureRecognizer-to-GestureBinding" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="865.764,539,856.764,535,860.764,539,856.764,543,865.764,539" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link GestureBinding to GestureArenaManager--><g id="link_GestureBinding_GestureArenaManager"><path codeLine="37" d="M937.5,575.272 C937.5,595.224 937.5,611.821 937.5,631.763 " fill="none" id="GestureBinding-backto-GestureArenaManager" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="937.5,563.272,933.5,569.272,937.5,575.272,941.5,569.272,937.5,563.272" style="stroke:#181818;stroke-width:1.0;"/></g><!--reverse link GestureBinding to PointerRouter--><g id="link_GestureBinding_PointerRouter"><path codeLine="38" d="M987.9444,569.2994 C1022.4064,589.3174 1061.48,612.009 1095.83,631.959 " fill="none" id="GestureBinding-backto-PointerRouter" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="977.568,563.272,980.7471,569.7445,987.9444,569.2994,984.7654,562.8269,977.568,563.272" style="stroke:#181818;stroke-width:1.0;"/></g><!--SRC=[ZLHDRy8m3BtdLqGzmJIGTfscIUkOs044AaWSfz1QRQREOMdusiP_Nze4rj0KTeaKs-yz-xdf40grbZ001R4IajxqUZHYsw4R9irGI-LCCGMa9Kw3kw321HXGMn11B5BaNo198q8VVdJn1646dsl069gOIqa3dqh-mUH-AZWga4s6E6T5qJO9_IQKlcKCanmimq1iiGCRGDKb1uiEMG5pjcfsKC9P7CDAsLn7Sz2LOUhgf8HthUPD7iYLriryRTgajQaAveNyIt0aC9rAA8ecldNnvT97l5209yUFryeZWJLtzUHanZ7DuJdZUH819Y0dozAe1KzIKBOFby-KMHg7tAplfLoPMTmjrOVSbnQV2glFsKVXqaknsuTYj-0gU-LghcSD8MCRBepKKeYSPYRHwVVxfOIB7FCTHpE0cw3tTAjPlN86T2vGkIC1_K8-3K_RvFfWTQ8pRou-lzxZyP6771EzKE9UAyzjw4dFmSOCMVht8wYNMU58hFNv2m00]--></g></svg>

<h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://book.flutterchina.club/chapter8/hittest.html#_8-3-1-flutter-%E4%BA%8B%E4%BB%B6%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B">《Flutter实战·第二版》 8.3 Flutter事件机制</a><br><a target="_blank" rel="noopener external nofollow noreferrer" href="https://cloud.tencent.com/developer/news/767886">深入理解Flutter手势系统</a></p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Flutter/" rel="tag"># Flutter</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/posts/30614.html" rel="prev" title="算法复杂度">
                  <i class="fa fa-angle-left"></i> 算法复杂度
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/posts/78efaca4.html" rel="next" title="okhttp详解系列一：开篇">
                  okhttp详解系列一：开篇 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 
    <span itemprop="copyrightYear">2024</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">Jason</span>
  </div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener external nofollow noreferrer" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener external nofollow noreferrer" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.24/fancybox/fancybox.umd.js" integrity="sha256-oyhjPiYRWGXaAt+ny/mTMWOnN1GBoZDUQnzzgC7FRI4=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>


  <script class="next-config" data-name="mermaid" type="application/json">{"enable":true,"theme":{"light":"default","dark":"dark"},"js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.5.0/mermaid.min.js","integrity":"sha256-K7oJiQlDulzl24ZUFOywuYme1JqBBvQzK6m8qHjt9Gk="}}</script>
  <script type="module" src="/js/zenuml-definition-074a43fa.js"></script>
  <script type="module" src="/js/mermaid-zenuml.esm.min.mjs"></script>
  <script src="/js/third-party/tags/mermaid.js"></script>


  <script src="/js/third-party/fancybox.js"></script>



  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>



</body>
</html>
